////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//  Filename:    BigShotGuts.h                                                //
//  Developer:   Omar Segura                                                 //
//  Create date: 09/07/2007                                                   //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//  Description: This is the class declaration for the slot gut of the        //
//               Australian Slot machine called BigShot .                     //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
//        Copyright (c) 2007 - Realtime Gaming.  All rights reserved.         //
////////////////////////////////////////////////////////////////////////////////

#if !defined(__BIGSHOTGUTS_H__)
#define __BIGSHOTGUTS_H__

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "slotguts.h"

class BigShotGuts : public SlotGuts
{
public:
	BigShotGuts();

	virtual ~BigShotGuts();

private:
	// Shared enums between client and server
	#include "BigShotCommon.h"

	// Helpful lookup arrays.
	static SpinResult m_aLineWinSpinResults[][6];

	static SpinResult m_aScatterWinSpinResults[6];

	// Inline functions to use with the arrays that also do
	// bounds checking.
	static SpinResult lookupLineWinSpinResult( uint8 nIconType, uint8 nCount )
	{
		if ( nIconType < NUM_VALID_ICONS && nCount < 6 )
		{
			return m_aLineWinSpinResults[ nIconType ][ nCount ];
		}
    
		ASSERT( false );
		return EVT_INVALID;
	}

	static SpinResult lookupScatterWinSpinResult( uint8 nCount )
	{
		if ( nCount < 6 )
		{
			return m_aScatterWinSpinResults[ nCount ];
		}

		ASSERT( false );
		return EVT_INVALID;
	}

	// Helper functions for classifyStops.
	SpinResult getLineWinResultWithPossibleSubstitution(
		uint8* stops, uint8 testIcon, bool& bSubstitution ) const;

	// Helper functions for classifyScatters.
	void tryForJackpot( SlotSpin* spin );

	SpinResult getScatterWinResult( SlotSpin* spin, int32& nNumScatterIcons, int32& nScatterPositions ) const;
	
	void addScatterWin( SlotSpin* spin, SpinResult srScatterResult, int32 nScatterPositions );

	void addFeatureTrigger( SlotSpin* spin, SpinResult srFeatureTriggerResult, int32 featurePositions );

	SpinResult getFreeGameWinResult( SlotSpin* spin, int32& featurePositions ) const;

	// This helper method is used to count the number of scatter icons.
	uint8 getNumScatterIcons( SlotSpin* spin, uint8 nIconType, int32& scatterPositions ) const;

	bool isSubstitute( uint8 icon ) const;

	// Helper function to determine woman payout formed with
	// substitutes icons only.
	SpinResult getSubstituteStripPayout( uint8* stops ) const;
	

public:
	virtual void classifyStops( SpinLine* spinline, uint8* stops, uint8 bet, uint8 line,
		uint8& rtnresult, uint8& multiplier );

	virtual void classifyScatters( SlotSpin *spin );
    virtual bool8 isValidGuts();
    virtual void getGameModeMultiplierAndNoteId( uint8& nGameModeMultiplier, uint8& nNoteId );

	virtual void  setNumSpinsSinceFirstTrigger(int32 nNumSpinsSinceFirstTrigger);
	virtual int32 getNumSpinsSinceFirstTrigger() const;

protected:
	virtual void Debug_SetLoserStops( uint8* pStops );
	virtual void preSpinClassifyResults(SlotSpin *spin);
};


#endif // !defined(__BIGSHOTGUTS_H__)